package com.mcy.threed.jpct;

import java.io.InputStream;

import android.content.res.AssetManager;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;

public class ResourceLoader {

	/**
	 * 获取资源图片
	 * @param res
	 * @param resid
	 * @return
	 */
	public static Bitmap loadBitmap(Resources res,int resid){

		return BitmapFactory.decodeResource(res, resid);
	}
	/**
	 * 获取资源文件输入流
	 * @param res
	 * @param filename
	 * @return
	 */
	public static InputStream loadFile(Resources res,String filename){
		AssetManager am = res.getAssets();
		try {
			return am.open(filename, AssetManager.ACCESS_UNKNOWN);
		} catch (Exception e) {
			return null;
		}
	}
}
